﻿using ServiceOperater.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace ServiceOperater.Templates
{
    public sealed class FileTreeTemplateSelector : DataTemplateSelector
    {

        public DataTemplate FileTemplate { get; set; }
        public DataTemplate ServiceTemplate { get; set; }

        public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            if (item is FileTreeNodeViewModel)
            {
                return FileTemplate;
            }

            if (item is ServiceTreeNodeViewModel)
            {
                return ServiceTemplate;
            }

            return null;
        }
    }
}
